<?
class Realestatetype_model extends Model{	
	function Realestatetype_model(){
		parent::Model();		
	}	
	function get_content(){		
		$this->db->select('t.id');
		$this->db->from('realestate_type t');
		$this->db->join('realestate_category c','t.categoryid=c.id');		
		$this->db->order_by('c.sortorder,t.sortorder');
		$res = $this->db->get();
		$list = array();	
		foreach($res->result() as $value){
			$list[$value->id] = get_content('realestate_type',$value->id)->name;
		}			
		return $list;
	}	
	
	function get_content_by_id($id){
		$this->db->select('t.id');
		$this->db->from('realestate_type t');
		$this->db->join('realestate_category c','t.categoryid=c.id');		
		$this->db->where('categoryid',$id);
		$this->db->order_by('c.sortorder,t.sortorder');
		$res = $this->db->get();
		$list = array();	
		foreach($res->result() as $value){			
			$list[$value->id] = get_content('realestate_type',$value->id)->name;			
		}				
		return $list;
	}
}
/* End of file */